from collections import deque

from cmath import inf
class StockSpanner:

    def __init__(self):
        self.stack = deque([(-1, inf)])
        self.index = 0

    def next(self, price: int) -> int:
        while len(self.stack) > 0 and self.stack[-1][1] <= price:
            self.stack.pop()
        ans = self.index - self.stack[-1][0]
        self.stack.append((self.index, price))
        self.index += 1
        return ans


queue = deque([100, 200])

while queue:
    print(queue.pop())

# Your StockSpanner object will be instantiated and called as such:
# obj = StockSpanner()
# param_1 = obj.next(price)